{% include 'header.html' %}
<title>Wox - Admin/Machine</title></head>


<body class="defect-opensolaris-org-bz">
{% include 'topnav.html' %}
<div>
  <table id="tabtitles" border="0" cellpadding="0" cellspacing="0">
  <tbody><tr>
    <td id="title">
    <p><a href="{%url machine_list%}" style="color:#FFFFFF">&nbsp;Admin</a> &raquo; Machine</p>
    </td></tr>
  </tbody></table>
</div>

<div id="bugzilla-body" style="overflow: hidden;">
 
 
 <div>
 <form action="list" method="GET">
 {% csrf_token %} 
 <table width="77%" border="0" align="left">
  
  <tr>
    <td><b>Host:</b>
      <input name="host" type="text" class="txt" id="text"  width="100%" value="{{host|escape}}">
      <b>Owner:</b>
      <select name="owner" width="100px">
      <option value=""></option>
      {% for owner_user in owner_list %}
      <option value="{{owner_user.username}}">{{owner_user.username}}</option>
      {% endfor %} 
      </select>
      <b>Group:</b>
      <select name="groupname" width="100px">
      <option value=""></option>
      {% for group in group_list %}
      <option value="{{group.name}}">{{group.name}}</option>
      {% endfor %} 
      </select>
    
	
	
      <input name="submit" type="submit" value=" Find " >&nbsp;&nbsp;
    <input name="submit2" type="button" onClick="location.href='{% url machine_add %}'" value=" New " >	</td>
    </tr>
</table>
</form>
</div>

<br>


<table class="bz_buglist" cellpadding="4" cellspacing="0" width="100%">
  <tbody>
  </tbody></table>


<div><br></div>
<div>
{% if host or owner or group %}
<b>Machine List Search Results</b>
{% else %}
<b>Machine List:</b>
{% endif %}
<br></div>
<hr>

{%if results %}
<form method="POST" action="">
<table class="bz_buglist" cellpadding="4" cellspacing="0" width="100%" align="center">
  <tbody>
<tr class="bz_buglist_header" align="left">
<th class="first-child">Hostname</th>
<th>Mode</th>
<th>Mac</th>
<th>Group</th>
<th>Owner</th>
<th>Domain</th>
<th>Actions</th>
</tr>

{% for machine in results %}
  {% if forloop.counter|divisibleby:2 %}
<tr class="bz_bugitem bz_row_odd">
  {% else %}
<tr class="bz_bugitem bz_row_even">
  {% endif %}
  <td class="first-child">
    <a id="item_{{machine.id}}" onMouseOver="showMessage('{{machine.id}}')" onMouseOut="hideMessage()">
    {{machine.hostname}}</a></td>
  <td>{{machine.hwmode.name}}</td>
  <td>{{machine.mac}}</td>
  <td>{{machine.group.name}}</td>
  <td>{{machine.owner.username}}</td>
  <td>{{machine.domain.name}}</td>
  {% if machine.reserve_email %}
    {% if machine.reserve_email == user.email %}
  <td><a href="{%url reserve_del machine.id%}">Unreserve</a>
    {% else %}
  <td>{{machine.reserve_email}}
    {% endif %}
  {% else %}
  <td><a href="{% url reserve_add machine.id %}">Reserve</a>
  {% endif %}
    | <a href="{% url machine_update machine.id %}">Update</a> | 
    <a href="{% url machine_delete machine.id %}" onClick="return confirm('Do you want to delete it?')">Delete</a></td>
  <td style="white-space: nowrap;"></td>
</tr>
{% endfor %}
  </tbody></table>
</form>
<hr>
{% else %}
 <p>No machine found.</p>
{% endif %}
<br><br>
</div>

{% for machine in results %}
<div align="left" id="div_{{machine.id}}" class="tooltip_msg2" style="display:none">
<table>
  <tr>
    <td align="right">Hostname : </td>
    <td align="left">{{machine.hostname}}</td>
  </tr>
  <tr>
    <td align="right">Mac : </td>
    <td align="left">{{machine.mac}}</td>
  </tr>
  <tr>
    <td align="right">Owner : </td>
    <td align="left">{{machine.owner.username}}</td>
  </tr>
  <tr>
    <td align="right">IP Addr. Type : </td>
    <td align="left">{{machine.ipaddr_type.name}}</td>
  </tr>
  <tr>
    <td align="right">Group : </td>
    <td align="left">{{machine.group.name}}</td>
  </tr>
  <tr>
    <td align="right">Location :</td>
    <td align="left">{{machine.location.name}}</td>
  </tr>
  <tr>
    <td align="right">Mode : </td>
    <td align="left">{{machine.hwmode.name}}</td>
  </tr>
  <tr>
    <td align="right">Domain : </td>
    <td align="left">{{machine.domain.name}}</td>
  </tr>
  <tr>
    <td align="right">Serial No. : </td>
    <td align="left">{{machine.serial_no}}</td>
  </tr>
  <tr>
    <td align="right">SP Hostname : </td>
    <td align="left">{{machine.sp_hostname}}</td>
  </tr>
  <tr>
    <td align="right">Notif. Emails : </td>
    <td align="left">{{machine.notification_email}}</td>
  </tr>
  <tr>
    <td align="right">Comments : </td>
    <td align="left">{{machine.comments}}</td>
  </tr>
  </table>
</div>
{% endfor %}


{% include 'footer.html'%}
